using UnityEngine;

public class ManagerHUDMissionLobby : MonoBehaviour
{
	public static ManagerHUDMissionLobby instance;

	public ManagerScrollMissions scrollMissions;

	public WindowNewMission winNewMission;

	public WindowCompleteMission winCompleteMission;

	public GameObject labelJobs;

	private void Awake()
	{
		instance = this;
		HideAllWindow();
	}

	private void Start()
	{
		ManagerMissions.instance.CheckIsExistCompleteMissions();
	}

	private void OnDestroy()
	{
		instance = null;
	}

	public void HideAllWindow()
	{
		SetActiveScrollMissions(false);
		winNewMission.gameObject.SetActive(false);
		winCompleteMission.gameObject.SetActive(false);
	}

	public void ShowPanelScrollMissions()
	{
		SetActiveScrollMissions(true);
	}

	public void SetActiveScrollMissions(bool val)
	{
		if (scrollMissions != null)
		{
			scrollMissions.gameObject.SetActive(val);
		}
	}

	public void ShowWindowNewMission(MissionBase needMis)
	{
		if (BCWDebug.isDebugBuild)
		{
			BCWDebug.Log("ShowWindowNewMission");
		}
		controllerMenu.thisScript.hideAllPanelMenu();
		winNewMission.UpdateParametrMission(needMis);
		winNewMission.gameObject.SetActive(true);
	}

	public void CloseWindowNewMission()
	{
		controllerMenu.thisScript.hideAllPanelMenu();
		ManagerMissions.instance.ShowInfoAndStartNewMissions();
		scrollMissions.UpdateListMissions();
	}

	public void ShowWindowCompleteMission(MissionBase needMis)
	{
		if (BCWDebug.isDebugBuild)
		{
			BCWDebug.Log("ShowWindowNewMission");
		}
		controllerMenu.thisScript.hideAllPanelMenu();
		winCompleteMission.UpdateParametrMission(needMis);
		winCompleteMission.gameObject.SetActive(true);
	}

	public void CloseWindowCompleteMission()
	{
		controllerMenu.thisScript.hideAllPanelMenu();
		scrollMissions.UpdateListMissions();
		ManagerMissions.instance.CheckIsExistCompleteMissions();
	}
}
